﻿using MiniFox.Configurations;
using System;
using System.Collections.Generic;

using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MiniFox.Components
{
    /// <summary>
    /// 备用组件类型特性，用于为契约类型设置备用组件，备用组件将在契约类型实例化失败时自动为契约类型实例化对象
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)]
    public sealed class SpareComponentAttribute : Attribute
    {
        Type _type;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="type"></param>
        public SpareComponentAttribute(Type type)
        {
            _type = type;
        }
        /// <summary>
        /// 
        /// </summary>
        public Type Type
        {
            get { return _type; }
        }
    }
}
